#include "GameRun.h"
#include "GameRunInput.h"

void GameRunInput::setInput(int keycode, bool onHold) {
		if (keycode == DIK_1 || keycode == DIK_2 || keycode == DIK_3) {
			int delta = keycode - DIK_1;
			GameDeviceSingleton::getInstance()->setCurrentMapLevel(delta + 1);
			_gamerun->onChangeMap();
		}
		if (keycode == DIK_RIGHT) {
			_contraEntity->moveRight();
		}
		if (keycode == DIK_LEFT) {
			_contraEntity->moveLeft();
		}
		if (keycode == 0) {
			_contraEntity->stand();
		}
		if (keycode == DIK_Z) {
			_contraEntity->fly(onHold);
		}
		if (keycode == DIK_UP) {
			_contraEntity->standUp();
		}
		if (keycode == DIK_DOWN) {
			_contraEntity->sit();
		}
		if (keycode == DIK_SPACE) {
			_contraEntity->fire(onHold);
		}
		if (keycode == DIK_A) {
			_contraEntity->updateData(0, 1);
		}
		if (keycode == DIK_S) {
			_contraEntity->updateData(0, 2);
		}
		if (keycode == DIK_D) {
			_contraEntity->updateData(0, 3);
		}
	}